package com.umf.b2b.demo.file;

import com.umpay.http.UMFFileClient;
import com.umpay.mer.ConfigContext;

import java.util.HashMap;
import java.util.Map;

/**
* @author zhanglz:
* @ClassName DownloadFile.java
* @Description 
*/

public class DownloadFile {
	
	static ConfigContext apiContext;

	static String url = "http://b2b.umfintech.com/merAccess/file/download/settleFile";
    static {
        apiContext = new ConfigContext(url, "90000002");
    }

	public static void main(String[] args) throws Exception {
		downloadFile();
	}

	static void downloadFile() throws Exception {
		Map<String, String> settleFileDownload = new HashMap<String, String>();
		settleFileDownload.put("mer_id", "90000002");
		settleFileDownload.put("mer_date", "20190522");
		settleFileDownload.put("version", "1.0");

		String localSettleFile = "D:\\settleFile\\90000002_20190524.csv";

		try {
			UMFFileClient.download(apiContext, settleFileDownload, localSettleFile);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
